<?
$total = $this->total;
$words = $this->words;
?>

<div class="content-box">

    <div class="content-box-header">
        <h3>Слова-фильтры</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab" href="#tab1">Таблица</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">

            Всего <?= $total ?>.

            <a href="/admin/filter/add" class="btn">Add new</a>

            <table>
                <thead>
                <tr>
                    <th>#</th>
                    <th>Слово</th>
                    <th></th>
                </tr>
                </thead>

                <tbody>
                <? foreach ($words as $word): ?>
                <tr>
                    <td><?= $word['id'] ?></td>
                    <td><?= $this->escape($word['word']); ?></td>
                    <td>
                        <a class="btn btn-success" href="/admin/filter/edit/id/<?= $word['id'] ?>">Edit</a>
                        <a class="btn btn-danger delete" href="/admin/filter/delete/id/<?= $word['id'] ?>">Delete</a>
                    </td>
                </tr>
                    <? endforeach; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>